
using UnityEngine;

public class MouseMan : Npc
{
    [Header("coll")]
    public GameObject collObj;

    [Header("没有集齐")]
    public SayData data1;
    [Header("集齐数量")]
    public SayData data2;
    [Header("已经用过了")]
    public SayData data3;
    private void Start()
    {
        collObj = transform.Find("CheckPosOne").gameObject;

        //隐藏
        collObj.GetComponent<Collider2D>().enabled = false;
    }
    private void OnMouseDown()
    {
        if (GameManager.Instance.canOprate==false) return;

        SceneItemManager.instance.clickEnemyRight = true;
        collObj.GetComponent<Collider2D>().enabled = true;
        SceneItemManager.instance.SetClickEnemy(gameObject);
    }
    //打开UI
    public void OpenLove()
    {
        Player player = GameManager.Instance.player;
        if (GameManager.Instance.redTurnNum <= 0)
        {
            sayData = data1;
        }
        else
        {
            sayData = data2;
        }
        sayData.myName = npcName;
        sayData.type = SayType.Npc;
        sayData.player = player;
        if (!SceneItemManager.instance.GetNpcData(npcName))
        {
            sayData = data3;
        }
        PanelManager.Open<SayPanel>(sayData);

        //关闭碰撞enable
        collObj.GetComponent<Collider2D>().enabled = false;
    }
}
